<extend name="template:common" />
//引入uploadify的样式
<block name="css">
    <css href="__UPLOADIFY__/uploadify.css" />
</block>
<block name="js">
    <!--引入layer-->
    <script src="__LAYER__/layer.js"></script>
    <script src="__UPLOADIFY__/jquery.uploadify.js"></script>
    <script>
        $(function() {
            $('#logo').uploadify({
                'fileObjName':'file',
                'buttonText':'选择文件',
                'swf'      : '__UPLOADIFY__/uploadify.swf',
                'uploader' : "{:U('Upload/upload')}",
                'onUploadSuccess':function(file,data){
//                    //转换成json对象
                    data = $.parseJSON(data);
                    if(data.status==1){
                        layer.msg('上传成功',{icon:6});
                        $("input[name='logo']").val(data.imgurl);
                        var a = '__SVN__'+data.imgurl+'?imageView2/1/w/200/q/75';
                        //构建缩略图节点
                        $(".imglog").append('<img class="iimg"/>');
                        $(".iimg").attr('src',a);
                    }else{
                        layer.msg('上传失败,原因是:'+data.msg,{icon:5})
                    }
                }
            });
        });
    </script>
<block name="main">
    <h1>
        <span class="action-span1"><a href="{:U('index')}">供货商管理</a></span>
        <span id="search_id" class="action-span1"> - {$meta_title} </span>
        <div style="clear:both"></div>
    </h1>
    <div class="main-div">
        <form method="post" action="{:U()}"enctype="multipart/form-data" >
            <table cellspacing="1" cellpadding="3" width="100%">
                <tr>
                    <td class="label">品牌名称</td>
                    <td>
                        <input type="text" id="namex" name="name" maxlength="60" value="{$row.name}" />
                        <span class="require-field">*</span>
                    </td>
                </tr>
                <tr>
                    <td class="label">品牌网址</td>
                    <td>
                        <input type="text" name="website" maxlength="50" value="{$row.website}" />
                    </td>
                </tr>
                <tr>
                    <td class="label">品牌logo</td>
                        <if condition="$row['logo']">
                            <td>
                            <img src="__SVN__{$row['logo']}?imageView2/1/w/200/q/75" alt="">
                            </td>
                            <else/>
                        <td class="imglog">
                        <input type="file" id="logo"/>
                        <input type="hidden" name="logo">
                            </if>


                    </td>
                </tr>
                <tr>
                    <td class="label">品牌描述</td>
                    <td>
                        <textarea  name="intro" cols="60" rows="4"  >{$row.intro}</textarea>
                    </td>
                </tr>
                <tr>
                    <td class="label">排序</td>
                    <td>
                        <input type="text" name="sort" maxlength="40" size="15" value="{$row.sort}" />
                    </td>
                </tr>
                <tr>
                    <td class="label">是否显示</td>
                    <td>
                        <input type="radio" name="status" value="1" checked="checked" /> 是
                        <input type="radio" name="status" value="0"  /> 否
                    </td>
                </tr>
                <tr>
                    <td colspan="2" align="center"><br />
                        <input type="hidden" value="{$row.id}" name="id">
                        <input type="submit" class="button" value=" 确定 " />
                        <input type="reset" class="button" value=" 重置 " />
                    </td>
                </tr>
            </table>
        </form>
    </div>
</block>
</block>
